<?php
     include_once('../src/classes/class.mysql.php');  
     
     $comtec_id_mainteiner = $_GET['m'];
     
     $db = new MySQL();
     
     $tsql = "select cod_order from orders 
              where comtec_id_mainteiner = $comtec_id_mainteiner
                    and status_reg = 1
              order by comtec_id_order desc Limit 20";
     
     $stmt = $db->query($tsql);
     
     
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
       <meta content="text/html; charset=utf-8" http-equiv="content-type" />
       <title>Las ultimas 20 ordenes de trabajo</title>
       <?php $url = "http://".$_SERVER['HTTP_HOST']."/css/comtec.css"; ?>
       <link rel="stylesheet" href="<?=$url?>" type="text/css" />
 </head>
 <body>
        <table class="table">
            <tr>
                <th></th>
                <th>C&oacute;digo</th>
            </tr>
            <?
            $cant = 0;
            while ($row = mysql_fetch_array($stmt, MYSQL_ASSOC)){
            $cant = $cant + 1;
            ?>
            <tr>
                <td><?=$cant?></td>
                <td><?=$row['cod_order']?></td>
            </tr>
            <?}?>
        </table>
 </body>
</html>